<template>
	<view class="page-section-gap">
		<web-view @message="getMessage" :class="isButton?'btn-class':''" :src="webUrl" v-if="webUrl"></web-view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				isButton: true,
				webUrl: ''
			}
		},
		onLoad(options) {
			console.log(options);
			if (options.url) {
				this.webUrl = decodeURIComponent(options.url);
			}
		},
		onShow() {

		},
		methods: {
			getMessage(e){
				uni.$emit('authCheck',true)
			},
		}
	}
</script>

<style lang="scss">
	web-view {
		box-sizing: border-box;
		// bottom: calc(40rpx + constant(safe-area-inset-bottom));
		// bottom: calc(40rpx + env(safe-area-inset-bottom));
		height: calc(100vh - env(safe-area-inset-bottom));
		height: calc(100vh - constant(safe-area-inset-bottom));
		width: 100vw;
	}

	.btn-class {
		height: calc(100vh - 50px - env(safe-area-inset-bottom)) !important;
		height: calc(100vh - 50px - constant(safe-area-inset-bottom)) !important;
	}

	.btn {
		z-index: 999;
		position: absolute;
		bottom: 10rpx;
		left: 0;
		width: 100%;
		height: 50px;
	}
</style>
